<template>
  <div style="display: flex" class="tempxyz menmuStyle">
    <CCard class="rightCard">
      <CCardHeader class="header-wraper">
        <div class="header-left-titleWraper"  @click="goback">
          <span class="textTitle"
            ><i
              class="fa fa-arrow-left"
              aria-hidden="true"
              style="color: #666"
             
            ></i
            >&nbsp;&nbsp;POD列表</span
          >
        </div>
      </CCardHeader>
      <CCardBody class="card-body">
        <div style="height: calc(100% - 46px)">
          <TableList ref="table" :getColumn="getColumns" :getAxios="getAxios">
            <template v-slot:show_details="item">
              <CButton
                title="流程"
                variant="outline"
                class="textBtnStyle onButton system-btn-style"
                @click="addMapUrl(item.data.row)"
                >流程</CButton
              >
            </template>
            <template v-slot:image="item">
              {{ dealData(item) }}
            </template>
          </TableList>
        </div>
      </CCardBody>
    </CCard>
  </div>
</template>
<script>
import TableList from "@/template/table/TableList";
export default {
  name: "podMonitorDetail",
  components: { TableList },
  data() {
    return {
      getColumns: [
        {
          title: "POD名称",
          key: "podName",
          className: "centerText",
        },

        {
          title: "执行算法",
          // slot: "image",
          key: "imageName",
          align:"center",
          className: "centerText",
        },

        {
          title: "所属作业",
          key: "groupTaskName",
          className: "centerText",
          sortType: "desc",
          align: "center",
        },
        {
          title: "内存",
          key: "memory",
          className: "centerText",
          align: "center",
        },
        {
          title: "CPU",
          key: "cpu",
          className: "centerText",
          align: "center",
        },
        {
          key: "show_details",
          slot: "show_details",
          title: "操作",
          align: "center",
          width: "220",
        },
      ],
      getAxios: {
        url:
          this.$api.monitorApi.podsName +
          `${this.$route.query.nodeName}` +
          "/pods", //请求路径
        method: "get", //请求方式
        dataList: {}, //请求参数
      },
    };
  },
  mounted() {},
  methods: {
    dealData(data) {
      var index = data.data.row.image.lastIndexOf("/");
      data.data.row.image = data.data.row.image.substring(
        index + 1,
        data.data.row.image.length
      );
      return data.data.row.image;
    },
    goback() {
      this.$router.go(-1);
    },
    addMapUrl(data) {
      console.log(data, "datatattattatat");
      this.$router.push({
        //nodeName
        path:
          "/taskManage/taskDetails/" +
          `${data.groupTaskId}/${data.workflowId}/${data.subTaskStatus}/${data.subTaskName}`,
        // path: '/taskManage/taskDetails/'+ `${this.$route.query.nodeId}/${this.$route.query.taskCode}/${this.$route.query.status}/${data.nodeName}`,
      });
    },
  },
};
</script>

<style scoped>
.rightCard {
  width: 80%;
  flex: 1;
}

.leftCard {
  width: 18%;
}
/deep/.card {
  margin-bottom: 0;
}
.headerMar {
  margin-left: 10px;
}
</style>


